package com.controller;

import com.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;

/**
 * Created by b5m on 2017/5/4.
 */
@Controller
@RequestMapping("/*")
public class MuiDemoController {

    /** b
     * spring中关于对页面请求的接口
     */
    @RequestMapping(value = "/demo")
    public ModelAndView MUIDemo(HttpServletRequest request) {
        Enumeration headerNames = request.getHeaderNames();
        while (headerNames.hasMoreElements()) {
            String name = headerNames.nextElement().toString();
            System.err.println(name + "--->" + request.getHeader(name));
        }
        ModelAndView mav = new ModelAndView();
        mav.setViewName("page/MUI/index");
        return mav;
    }

    /**
     * spring中关于对页面请求的接口
     */
    @RequestMapping(value = "/index.json")
    public ModelAndView index() {
        ModelAndView mav = new ModelAndView();
        mav.setViewName("page/one");
        return mav;
    }
}
